// Decompiled on 周六 2月 22 19:31:49 CST 2025 with Zomboid Decompiler v0.1.3 using Vineflower.
package zombie.commands.serverCommands;

import java.sql.SQLException;
import zombie.commands.CommandArgs;
import zombie.commands.CommandBase;
import zombie.commands.CommandHelp;
import zombie.commands.CommandName;
import zombie.commands.RequiredRight;
import zombie.core.logger.LoggerManager;
import zombie.core.raknet.UdpConnection;
import zombie.network.ServerWorldDatabase;

@CommandName(
    name = "removeuserfromwhitelist"
)
@CommandArgs(
    required = {"(.+)"}
)
@CommandHelp(
    helpText = "UI_ServerOptionDesc_RemoveWhitelist"
)
@RequiredRight(
    requiredRights = 48
)
public class RemoveUserFromWhiteList extends CommandBase {
    public RemoveUserFromWhiteList(String username, String userAccessLevel, String command, UdpConnection connection) {
        super(username, userAccessLevel, command, connection);
    }

    @Override
    protected String Command() throws SQLException {
        String string = this.getCommandArg(Integer.valueOf(0));
        LoggerManager.getLogger("admin").write(this.getExecutorUsername() + " removed user " + string + " from whitelist");
        return ServerWorldDatabase.instance.removeUser(string);
    }
}
